﻿using MediatR;
using RBAC.Domain;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.MenuCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.MenuHanders
{
    public class MenuGetIdCommandHandler : IRequestHandler<MenuGetIdCommand, Menu>
    {
        private readonly IMenuService _menuService;
        public MenuGetIdCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }
        public async Task<Menu> Handle(MenuGetIdCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetMenuValue(request.id);
        }
    }
}
